<template>
  <van-tabbar v-model="active">
    <van-tabbar-item icon="shop" to="/">首页</van-tabbar-item>
    <van-tabbar-item icon="cart" :info="buyCount" to="/cart">购物车</van-tabbar-item>
    <van-tabbar-item icon="gold-coin" info="20">我的</van-tabbar-item>
  </van-tabbar>
</template>

<script>
  import Vue from 'vue';
  import {
    Tabbar,
    TabbarItem
  } from 'vant';
  Vue.use(Tabbar).use(TabbarItem);
  export default {
    data() {
      return {
        active: 0
      }
    },
     computed: {
      buyCount () {
        return this.$store.state.buyCount
      }
    }
  }

</script>

<style>


</style>
